package com.api.wall.deletefromgroup;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.api.test.AbstractApiTest;
import com.zyncro.api.IWallApiService;
import com.zyncro.api.exceptions.ZyncroApiException;

@ContextConfiguration(locations = { "classpath:/wall/wall-context.xml" })
public class DeleteFromGroupNotParticipant extends AbstractApiTest {

	@Value("#{group_toPublish[notParticipant].appId}")
	private String userUrn;

	@Value("#{group_toPublish[notParticipant].password}")
	private String userPassword;

	@Value("#{group_toPublish.urn}")
	private String groupUrn;

	@Value("#{group_toPublish.eventUrn}")
	private String groupEventUrn;

	@BeforeClass
	protected void setParameters() throws Exception {

		getApi().login(userUrn, userPassword);

	}

	@Test(expectedExceptions = ZyncroApiException.class)
	public void testDeleteInGroup() throws ZyncroApiException {

		getApi().getService(IWallApiService.class).deleteFromGroup(groupUrn, groupEventUrn);
	}
}
